/*
 * Create in 2013-4-20 下午3:17:29.
 */
package kit4j.app.notepad.annotation;

import java.lang.annotation.Annotation;

/**
 * 
 * @author MiniKnife
 *
 */
public class NamedConfig implements Config {

	private final String value;
	
	public NamedConfig(String value) {
		this.value = value;
	}

	/**
	 * @see java.lang.annotation.Annotation#annotationType()
	 */
	@Override
	public Class<? extends Annotation> annotationType() {
		return Config.class;
	}

	public int hashCode() {
		return ((127 * "value".hashCode()) ^ value.hashCode());
	}
	
	public boolean equals(Object obj) {
		if(obj == this) {
			return true;
		}
		if(!(obj instanceof Config)) {
			return false;
		}
		Config other = (Config) obj;
		return value.equals(other.value());
	}
	
	/**
	 * @see kit4j.app.notepad.annotation.Config#value()
	 */
	@Override
	public String value() {
		return value;
	}

}